// packageActivitys/annualSpendingReport/annualSpendingReport.js
import {
    dybbAd
} from '../../api/app.js'
Page({

    /**
     * 页面的初始数据
     */
    data: {
        title: '',
        titleAll: '2023年度账单',
        timer: null,
        audioCtx: null
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        for (let i = 0; i < this.data.titleAll.length; i++) {
            this.data.timer = setTimeout(() => {
                this.data.title += this.data.titleAll[i]
                this.setData({
                    title: this.data.title
                })
            }, i * 200)
        }
    },
    tondzddetail() {
        console.log('去年度账单详情');
        this.data.audioCtx.stop()
        wx.navigateTo({
            url: '/packageActivitys/ndzdDetail/ndzdDetail',
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },
    ndzdbg() {
        dybbAd({
            isShare: 0,
            isExposure: 1,
            type: 1,
        }).then((res) => {
            console.log(res, 'fgasgyfjiusagygyasu');
        })
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        this.ndzdbg()
        this.playMusic()
    },
    playMusic() {
        this.data.audioCtx = wx.createInnerAudioContext()
        this.data.audioCtx.src = 'https://bullet001.oss-cn-shanghai.aliyuncs.com/file-music/activeBackgroundMusic7.MP3'
        this.data.audioCtx.autoplay = true
        this.data.audioCtx.play()
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})